package com.zt.event.service.status.bean;

import com.zt.event.enums.ApplicationStatusEnums;
import com.zt.event.service.status.listener.DefaultListenerProcess;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.stereotype.Component;

/**
 * @author system
 */
@Component
public class ShutDownHookBean extends DefaultListenerProcess implements DisposableBean {

    private final static long startTime = System.currentTimeMillis();



    @Override
    public void destroy() throws Exception {
        long endTime = System.currentTimeMillis();
        defaultHandleMessage(ApplicationStatusEnums.SERVER_STOP, "无", context, endTime - startTime);
    }

}
